package com.cleaningcloud.erp.mapper;

import java.util.List;

import com.cleaningcloud.erp.domain.ErpWareAllocateDetails;
import com.cleaningcloud.erp.domain.ErpWareCheck;
import com.cleaningcloud.erp.domain.ErpWareCheckDetails;
import com.cleaningcloud.erp.domain.vo.ErpWareCheckVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * 库存盘点Mapper接口
 * 
 * @author cleaningcloud
 * @date 2024-10-08
 */
public interface ErpWareCheckMapper 
{
    /**
     * 查询库存盘点
     * 
     * @param wareCheckId 库存盘点主键
     * @return 库存盘点
     */
    ErpWareCheckVo selectErpWareCheckByWareCheckId(Long wareCheckId);

    /**
     * 查询库存盘点列表
     * 
     * @param erpWareCheck 库存盘点
     * @return 库存盘点集合
     */
    List<ErpWareCheckVo> selectErpWareCheckList(ErpWareCheck erpWareCheck);

    /**
     * 新增库存盘点
     * 
     * @param erpWareCheck 库存盘点
     * @return 结果
     */
    int insertErpWareCheck(ErpWareCheck erpWareCheck);

    /**
     * 修改库存盘点
     * 
     * @param erpWareCheck 库存盘点
     * @return 结果
     */
    int updateErpWareCheck(ErpWareCheck erpWareCheck);

    /**
     * 删除库存盘点
     * 
     * @param wareCheckId 库存盘点主键
     * @return 结果
     */
    int deleteErpWareCheckByWareCheckId(Long wareCheckId);

    /**
     * 批量删除库存盘点
     * 
     * @param wareCheckIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteErpWareCheckByWareCheckIds(Long[] wareCheckIds);


    /**
     * 批量新增库存盘点明细
     * @param list
     */
    void batchInsertWareCheckDetails(@Param("list")List<ErpWareCheckDetails> list);

    /**
     * 根据库存盘点id批量擅长明细
     * @param wareAllocateId
     */
    @Delete("delete from `cleaningcloud-erp`.erp_ware_check_details where ware_check_id = #{wareCheckId}")
    void deleteWareCheckDetailsByWareCheckId(@Param("wareCheckId") Long wareCheckId);
}
